package com.hooper.sms.controller;

import com.hooper.hospital.common.result.Result;
import com.hooper.sms.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/10/04/0:03
 */
@Api("send message service")
@RequiredArgsConstructor
@Slf4j
@RestController
@RequestMapping("/api/sms/")
public class SmsController {

    private final SmsService smsService;

    @ApiOperation("send sms code")
    @GetMapping("send/{phone}")
    public Result<Integer> sendCode(@PathVariable String phone){
        smsService.sendCode(phone);
        return Result.ok();
    }
}
